﻿<?php

if(!defined('IN_PHPSCUP'))exit('hacking'); 
class JobApp extends BaseApp
{
    function index()
    {
		
		$TB_job = &$this->_model('job'); 
				
		$data = $TB_job->show();	
	    
		
        $this->assign('lw_data', $data['data']);		
		$this->assign('lw_page', $data['page']); 				
					
	    
        $this->assign('view_charset', VIEW_CHARSET);	
        $this->assign('page_title', $GLOBALS['Lang']->_get_lang_var(SITE_TITLE));
        $this->assign('page_description', $GLOBALS['Lang']->_get_lang_var(SITE_DESCRIPTION));
        $this->assign('page_keywords', $GLOBALS['Lang']->_get_lang_var(SITE_KEYWORDS));	
		
        $this->assign('site_url',SITE_URL);
		
        $this->assign('web_view_dir',SITE_URL.'/admin/view/default/');		
		
        $this->display('job_list.view.html');
    }


    function add()
    {
		
	
	    
        $this->assign('view_charset', VIEW_CHARSET);	
        $this->assign('page_title', $GLOBALS['Lang']->_get_lang_var(SITE_TITLE));
        $this->assign('page_description', $GLOBALS['Lang']->_get_lang_var(SITE_DESCRIPTION));
        $this->assign('page_keywords', $GLOBALS['Lang']->_get_lang_var(SITE_KEYWORDS));	
		
        $this->assign('site_url',SITE_URL);
		
        $this->assign('web_view_dir',SITE_URL.'/admin/view/default/');		
		
        $this->display('job_add.view.html');
    }
	

    function addpost()
    {

	     $data = $_POST['data'];
         
		 $data['user_id'] = $GLOBALS['SCup']->SCup_user_msg['user_id'];

		 $TB_job = &$this->_model('job');
		 		 		
		 $TB_job->post($data);
		 		 
		 $this->index();

    }

    function edit()
    {
		$id= intval($_GET['id']);
		
		$TB_job = &$this->_model('job'); 
				
		$data = $TB_job->oneshow($id);		

        $this->assign('data', $data);

        $this->assign('view_charset', VIEW_CHARSET);	
        $this->assign('page_title', $GLOBALS['Lang']->_get_lang_var(SITE_TITLE));
        $this->assign('page_description', $GLOBALS['Lang']->_get_lang_var(SITE_DESCRIPTION));
        $this->assign('page_keywords', $GLOBALS['Lang']->_get_lang_var(SITE_KEYWORDS));	
		
        $this->assign('site_url',SITE_URL);
		
        $this->assign('web_view_dir',SITE_URL.'/admin/view/default/');		
		
        $this->display('job_edit.view.html');
      

    }

    function editpost()
    {
		$id= intval($_POST['id']);
		
		$data = $_POST['data'];
   
		$TB_job = &$this->_model('job'); 		
				
		$TB_job->editaction($id,$data);
			
		$this->index();  	      

    }
	
	

    function del()
    {
		$id= intval($_GET['id']);		

		$TB_job = &$this->_model('job'); 		
		$TB_job->del($id);
				      
        $this->index();    
    }	
	
   
}





?>